<?php
use yii\widgets\ActiveForm;
?>
	<div class="animate-dropdown"><!-- ========================================= BREADCRUMB ========================================= -->
<div id="breadcrumb-alt">
    <div class="container">
<!--        <div class="breadcrumb-nav-holder minimal">
            <ul>
                <li class="dropdown breadcrumb-item">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        shop by department
                    </a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Computer Cases &amp; Accessories</a></li>
                        <li><a href="#">CPUs, Processors</a></li>
                        <li><a href="#">Fans, Heatsinks &amp; Cooling</a></li>
                        <li><a href="#">Graphics, Video Cards</a></li>
                        <li><a href="#">Interface, Add-On Cards</a></li>
                        <li><a href="#">Laptop Replacement Parts</a></li>
                        <li><a href="#">Memory (RAM)</a></li>
                        <li><a href="#">Motherboards</a></li>
                        <li><a href="#">Motherboard &amp; CPU Combos</a></li>
                        <li><a href="#">Motherboard Components</a></li>
                    </ul>
                </li>
                <li class="breadcrumb-item">
                    <a href="#">Home</a>
                </li>
                <li class="breadcrumb-item current">
                    <a href="#">Checkout Process</a>
                </li>
            </ul> /.breadcrumb-nav-holder 
        </div>-->
    </div><!-- /.container -->
</div>
<!-- ========================================= BREADCRUMB : END ========================================= --></div>
</header>
<!-- ============================================================= HEADER : END ============================================================= -->		<!-- ========================================= CONTENT ========================================= -->

<section id="checkout-page">
    <div class="container">
        <div class="col-xs-12 no-margin">
            
            <div class="billing-address">
                <h2 class="border h1">收货地址</h2>
                    <a href="#" id="createlink">新建联系人</a>
                    <?php foreach ($address as $value):?>
                    <div class="row field-row" style="margin-top:10px">
                        <div class="col-xs-12">
                            <input class="le-radio big address" type="radio" name="address" value="地址id" checked="" /> 
                            <a class="simple-link bold" href="#"><?php echo $value['firstname'].$value['lastname'].", ".$value['company'].$value['address'].",".$value['postcode'].",".$value['email'].",".$value['telephone']?></a>
                        </div>
                        <a style="margin-left:45px" href="<?php echo \yii\helpers\Url::to(['address/del','addressid'=>$value['addressid']])?>">删除</a>
                    </div><!-- /.field-row -->
                    <?php endforeach;?>
                <div class="billing-address" style="display:none;">
                    <?php $form= ActiveForm::begin([
                        'action'=> \yii\helpers\Url::to(['address/add']),
                    ])?>
                    <div class="row field-row">
                        <div class="col-xs-12 col-sm-6">
                            <?php echo $form->field($addressModel, 'firstname')->textInput(['class'=>'le-input'])?>
<!--                            <label>姓*</label>
                            <input class="le-input" >-->
                        </div>
                        <div class="col-xs-12 col-sm-6">
                            <?php echo $form->field($addressModel, 'lastname')->textInput(['class'=>'le-input'])?>
<!--                            <label>名*</label>
                            <input class="le-input" >-->
                        </div>
                    </div><!-- /.field-row -->

                    <div class="row field-row">
                        <div class="col-xs-12">
                            <?php echo $form->field($addressModel, 'company')->textInput(['class'=>'le-input'])?>
<!--                            <label>公司名称</label>
                            <input class="le-input" >-->
                        </div>
                    </div><!-- /.field-row -->

                    <div class="row field-row">
                        <div class="col-xs-12 col-sm-6">
                            <?php echo $form->field($addressModel, 'address')->textInput(['class'=>'le-input','data-placeholder'=>'例如：武汉市洪山区'])?>
<!--                            <label>地址*</label>
                            <input class="le-input" data-placeholder="例如：武汉市洪山区" >-->
                        </div>
                        <div class="col-xs-12 col-sm-6">
                            <?php echo $form->field($addressModel, 'addressDetail')->textInput(['class'=>'le-input','data-placeholder'=>'例如：珞喻路152号'])?>
<!--                            <label>&nbsp;</label>
                            <input class="le-input" data-placeholder="例如：珞喻路152号" >-->
                        </div>
                    </div><!-- /.field-row -->

                    <div class="row field-row">
                        <div class="col-xs-12 col-sm-4">
                            <?php echo $form->field($addressModel, 'postcode')->textInput(['class'=>'le-input'])?>
<!--                            <label>邮编*</label>
                            <input class="le-input"  >-->
                        </div>
                        <div class="col-xs-12 col-sm-4">
                            <?php echo $form->field($addressModel, 'email')->textInput(['class'=>'le-input'])?>
<!--                            <label>电子邮箱地址*</label>
                            <input class="le-input" >-->
                        </div>

                        <div class="col-xs-12 col-sm-4">
                            <?php echo $form->field($addressModel, 'telephone')->textInput(['class'=>'le-input'])?>
<!--                            <label>联系电话*</label>
                            <input class="le-input" >-->
                        </div>
                    </div><!-- /.field-row -->
                    <div class="place-order-button">
                        <button class="le-button small">新建</button>
                    </div><!-- /.place-order-button -->
                    
<!--                    <div class="row field-row">
                        <div id="create-account" class="col-xs-12">
                            <input  class="le-checkbox big" type="checkbox"  />
                            <a class="simple-link bold" href="#">Create Account?</a> - you will receive email with temporary generated password after login you need to change it.
                        </div>
                    </div> /.field-row -->
                <?php ActiveForm::end()?>
                </div>
            </div><!-- /.billing-address -->


<!--            <section id="shipping-address">
                <h2 class="border h1">送货地址</h2>
                <form>
                    <div class="row field-row">
                        <div class="col-xs-12">
                            <input  class="le-checkbox big" type="checkbox"  />
                            <a class="simple-link bold" href="#">ship to different address?</a>
                        </div>
                    </div> /.field-row 
                </form>
            </section> /#shipping-address -->


            <section id="your-order">
                <h2 class="border h1">您的订单详情</h2>
                <?php $form= ActiveForm::begin([
                    'action'=> \yii\helpers\Url::to(['order/confirm']),
                ])?>
                <?php $totalprice=0;?>
                    <?php foreach ($orderDetail as $product):?>
                    <div class="row no-margin order-item">
                        <div class="col-xs-12 col-sm-1 no-margin">
                            <a href="#" class="qty"><?php echo $product['productnum']?> x</a>
                        </div>

                        <div class="col-xs-12 col-sm-9 ">
                            <div class="title"><a href="#"><?php echo $product['title']?></a></div>
                            <div class="brand">sony</div>
                        </div>

                        <div class="col-xs-12 col-sm-2 no-margin">
                            <div class="price"><?php echo $product['price']?></div>
                        </div>
                    </div><!-- /.order-item -->
                    <?php $totalprice+=$product['price']*$product['productnum']?>
                    <?php endforeach;?>
                
            </section><!-- /#your-order -->

            <div id="total-area" class="row no-margin">
                <div class="col-xs-12 col-lg-4 col-lg-offset-8 no-margin-right">
                    <div id="subtotal-holder">
                        <ul class="tabled-data inverse-bold no-border">
                            <li>
                                <label>商品总价</label>
                                <div class="value ">￥<?php echo $totalprice?></div>
                            </li>
                            <li>
                                <label>选择快递</label>
                                <div class="value">
                                    <div class="radio-group">
                                        <input class="le-radio" type="radio" name="expressid" value="free"> <div class="radio-label bold">免邮</div><br>
                                        <?php foreach ($express as $key=>$exp):?>
                                        <?php $checked="";if($key==2) $checked="checked"?>
                                        <input class="le-radio" type="radio" name="expressid" value="<?php echo $key?>" <?php echo $checked?>>  <div class="radio-label"><?php echo $exp?><span class="bold">$<?php echo $expressPrice[$key]?></span></div><br>
                                        <?php endforeach;?>
                                    </div>
                                </div>
                            </li>
                        </ul><!-- /.tabled-data -->

                        <ul id="total-field" class="tabled-data inverse-bold ">
                            <li>
                                <label>订单总额</label>
                                <div class="value">￥<?php echo $totalprice+20?></div>
                            </li>
                        </ul><!-- /.tabled-data -->

                    </div><!-- /#subtotal-holder -->
                </div><!-- /.col -->
            </div><!-- /#total-area -->

            <div id="payment-method-options">
                    <div class="payment-method-option">
                        <input class="le-radio" type="radio" name="paymethod" value="alipay" checked>
                        <div class="radio-label bold ">支付宝支付r<br>
                            <!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce rutrum tempus elit, vestibulum vestibulum erat ornare id.</p>-->
                        </div>
                    </div><!-- /.payment-method-option -->
                    
                    <div class="payment-method-option">
                        <input class="le-radio" type="radio" name="paymethod" value="weixinpay">
                        <div class="radio-label bold ">微信支付</div>
                    </div><!-- /.payment-method-option -->
            </div><!-- /#payment-method-options -->
            
            <div class="place-order-button">
                <button class="le-button big">确认订单</button>
            </div><!-- /.place-order-button -->

        </div><!-- /.col -->
    </div><!-- /.container -->    
</section><!-- /#checkout-page -->
<input type="hidden" value="<?php echo (int)Yii::$app->request->get('orderid')?>" name="orderid"/>
<?php ActiveForm::end()?>
<!-- ========================================= CONTENT : END ========================================= -->		